package com.woniuxy.activiti.service;

import com.woniuxy.activiti.mapper.SiteMessageMapper;
import com.woniuxy.entity.SiteMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author xilei
 * @create 2021-11-16 15:36
 */
@Service
public class SiteMessageService {

    @Resource
    private SiteMessageMapper siteMessageMapper;

    public List<SiteMessage> findAll(Integer userId) {
        return siteMessageMapper.selectMsgList(userId);
    }

    public SiteMessage findOne(Integer id,Integer userId) {
        return siteMessageMapper.selectOneMsg(id,userId);
    }

    public int readMsg(Integer id,Integer userId) {
        return siteMessageMapper.updateMsgRead(id,userId);
    }

    public int sendMsg(Integer userId, String taskId,Integer type,Integer isread) {
        return siteMessageMapper.insertMsg(userId,taskId,type,isread);
    }

}
